// 引入 vue
import Vue from "vue";
// 引入对应画面
import Find from '../view/find'
import My from '../view/my'
import Part from '../view/part'
import Tel from '../view/tel'
import NotFound from '../view/NotFound'

// 引入vueroutrer
import VueRouter from "vue-router";
// 使用VueRouter
Vue.use(VueRouter)
//  创建new VueRouter
const router = new VueRouter({
    routes:[
        // 里面放对象 地址 组件
        {
            path:'/',
            redirect:"/find"
        },
        {
            path:'/find',
            component:Find,
        },
        {
            path:'/my/:userName/:age',
            component:My,
        },
        {
            path:'/part',
            component:Part,
        },
        {
            path:'/tel',
            component:Tel,
        },
        {
            path:'*',
            component: NotFound
        },
        
    ]
})
export default router